package com.xiaolong.redis.handle;

import com.xiaolong.redis.annotation.Cache;
import com.xiaolong.redis.util.CacheUtil;
import org.aspectj.lang.ProceedingJoinPoint;

public class ExpireCacheHandler implements CacheHandler {
    @Override
    public Object saveCache(ProceedingJoinPoint point, Cache cache) throws Throwable {
        Object result = point.proceed();
        CacheUtil.fillStr(cache.key(), result, cache.timeOut());
        return result;
    }
}
